package com.chuangke.lowcode.component.handle;

import com.chuangke.common.db.query.QueryBuilder;
import com.chuangke.common.db.query.enums.JoinEnum;
import com.chuangke.lowcode.LowCodeContext;
import com.chuangke.lowcode.component.ProgressComponent;
import org.springframework.stereotype.Component;

/**
 * QueryWrapper组织组件
 */
@Component
public class BeforeActionHandlerQueryWrapperComponent implements ProgressComponent {

    @Override
    public void process(LowCodeContext modelContext) {
        QueryBuilder.buildQueryWrapperByCondition(modelContext.getQueryWrapper(), JoinEnum.and.name(),modelContext.getConditions()) ;
        QueryBuilder.buildQueryWrapperByOrder(modelContext.getQueryWrapper(),modelContext.getOrders()) ;
    }

}
